package com.boot.security.service.authentication;

import com.boot.security.model.bo.LoginAccountAuthentication;
import com.boot.security.model.dto.RegisterAccount;
import com.boot.security.model.vo.AccountInfo;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 霜寒 <1621856595@qq.com>
 * @description 用户账户业务
 * @date 2020/4/12 17:42
 **/

public interface AccountService {

    /**
     * @author 霜寒 <1621856595@qq.com>
     * @description 注册账户
     * @date 2021/3/22 17:30
     **/
    boolean register(RegisterAccount registerAccount);

    /**
     * @author 霜寒 <1621856595@qq.com>
     * @description 获取用户账户信息
     * @date 2020/4/12 17:59
     **/
    AccountInfo getAccountInformation();

    /**
     * @author 霜寒 <1621856595@qq.com>
     * @description 登录验证
     * @date 2020/4/12 17:59
     **/
    Authentication authenticate(LoginAccountAuthentication authentication) throws AuthenticationException;

    /**
     * @author 霜寒 <1621856595@qq.com>
     * @description 更新用户账户信息
     * @date 2020/4/12 18:00
     **/
    AccountInfo upgradeAccountInformation(AccountInfo oldInfo);

    boolean upgradePassword(String oldPassword, String newPassword);

    boolean upgradePhone(String password, String newPhone);

    boolean deletePhone();

    boolean upgradeEmail(String password, String newEmail);

    boolean deleteEmail();

    String upgradeAvatar(MultipartFile avatar);
}
